package 二叉树;

import org.junit.Test;

import java.util.*;

/**
 * @author XZ
 * @create 2021-10-18 16:05
 */
public class testDeque {
    public static void main(String[] args) {
        Deque<Integer> deque = new ArrayDeque();
        deque.push(1);
        deque.push(2);
        deque.push(3);
        deque.push(4);
        deque.add(5);
        deque.addFirst(6);
        deque.addLast(7);

        Integer first = deque.pop();
        System.out.println(first);
        Integer peek = deque.peek();

        System.out.println(peek);
        System.out.println(deque);


        Stack<Integer> stack = new Stack<>();
    }

    @Test
    public void test01() {
        List<Integer> list1 = new LinkedList<>();
        List<Integer> list2 = new LinkedList<>();
        LinkedList<List<Integer>> lists = new LinkedList<>();
        LinkedList<List<Integer>> lists2 = new LinkedList<>();

        list1.add(1);
        list1.add(2);
        list2.add(3);
        list2.add(4);
        lists.add(list1);
        lists.add(list2);
        lists2 = lists;
        System.out.println(lists2);
        list1.clear();
        System.out.println(lists2);

    }

    @Test
    public void test02() {
        LinkedList<List<Integer>> lists = new LinkedList<>();

    }
}
